#include<iostream>
using namespace std;
class Plane    //飞机类
{
private:
    float wing;        //机翼长度
    float body;        //机身长度
    float tail;        //尾翼长度
    float voyage;      //航程
    int guest;         //旅客人数
public:
    Plane(float,float,float,float,int);
    void display();
};
void Plane::display()
{
    cout<<"Plane:\twing:"<<wing<<" body:"<<body<<" tail:"<<tail<<" voyage:"<<voyage<<" guest:"<<guest;
}
Plane::Plane(float w,float b,float t,float v,int n)
{
    wing=w;
    body=b;
    tail=t;
    voyage=v;
    guest=n;
}
//你的代码将被嵌在这里
class Fighter:public Plane
{
private:
    int missile;
public:
    Fighter(float,float,float,float,int,int);
    void display();
    void fight();
};
void Fighter::fight()
{
    cout<<"Fight!"<<endl;
}
void Fighter::display()
{
    cout<<"This is a fighter!"<<endl;
    Plane::display();
    cout<<endl;
    cout<<"missile:"<<missile<<endl;
}
Fighter::Fighter(float a,float b,float c,float d ,int e,int f):Plane(a,b,c,d,e),missile(f){

}


class Bomber:public Plane
{
private:
    int bomb;
public:
    Bomber(float,float,float,float,int,int);
    void display();
    void attack();
    void getbomb();
};
void Bomber::getbomb(){
    cout<<"bomb:"<<bomb<<endl;
}
Bomber::Bomber(float a,float b,float c,float d,int e,int f):Plane(a,b,c,d,e),bomb(f){

}
void Bomber::display()
{
    cout<<"This is a bomber!"<<endl;
    Plane::display();
    cout<<endl;
    cout<<"bomb:"<<bomb<<endl;
}
void Bomber::attack()
{
    cout<<"Attack!"<<endl;
}

class Fighter_Bomber:public Bomber,public Fighter
{
public:
    void display();
    Fighter_Bomber(float,float,float,float,int,int,int);
};
Fighter_Bomber::Fighter_Bomber(float a,float b,float c,float d,int e,int f,int g):Fighter(a,b,c,d,e,f),Bomber(a,b,c,d,e,g){
}
void Fighter_Bomber::display()
{
    cout<<"This is a fighter_bomber!"<<endl;
    Fighter::display();
    getbomb();
    fight();
    attack();
}

int main()
{
    Fighter f(10.0,6.0,2.5,1800,1,8);             //歼击机
    f.display();
    Bomber b(30,9,6,12000,12,6000);             //轰炸机
    b.display();
    Fighter_Bomber fb(20,7,3.2,4000,2,6,2500);    //歼轰机
    fb.display();
    return 0;
}

